JavaScript: The Good Parts by Douglas Crockford

JavaScript: The Good Parts by Douglas Crockford
Author: Douglas Crockford [Douglas Crockford]
Language: eng
Format: epub, mobi, pdf
Tags: COMPUTERS / Programming Languages / JavaScript
ISBN: 9780596158736
Publisher: Yahoo Press
Published: 2008-12-16

Regexp Group

There are four kinds of groups:

Capturing

A capturing group is a regexp choice wrapped in parentheses. The characters that match the group will be captured. Every capture group is given a number. The first capturing ( in the regular expression is group 1. The second capturing ( in the regular expression is group 2.

Noncapturing

A noncapturing group has a (?: prefix. A noncapturing group simply matches; it does not capture the matched text. This has the advantage of slight faster performance. Noncapturing groups do not interfere with the numbering of capturing groups.